<template name='storeRowList'>
	<view class="row store-main">
		<view class="col item" v-for="(item,index) in listData" v-bind:key="index" @click="toStoreHome" :data-id="item.id">
			<image :src="item.store_pic" mode="aspectFill"></image>
			<text class="text-ellipsis">{{item.store_name}}</text>
		</view>
	</view>
</template>

<script>
	var app = getApp();
	import common from '../common/js/function.js';
	export default {
		name: 'storeRowList',
		data() {
			return {
				url: app.globalData.baseImgUrl
			}
		},
		props: {
			listData: {
				type: Array
			}
		},
		methods: {
			toStoreHome: function(e) {
				common.verifyAuth(() => {
					app.globalData.storeId = e.currentTarget.dataset.id;
					uni.switchTab({
						url: '/pages/store/home/home'
					});
				})
			}
		}
	}
</script>

<style scoped>
	/* 收藏的店 */
	.store-main {
		flex-wrap: wrap;
		width: 100%;
	}

	.store-main .item {
		width: 25%;
		height: 200rpx;
		align-items: center;
	}

	.text-ellipsis {
		text-align: center;
	}

	.store-main .item image {
		margin-top: 20rpx;
		width: 130rpx;
		height: 130rpx;
		border-radius: 50%;
	}

	.store-main .item text {
		margin-top: auto;
		color: #333;
		font-size: 26rpx;

		width: 90%;
	}
</style>
